<template>
  <form-create v-model="fapi" :rule="rule" :option="option" @submit="onSubmit"></form-create>
</template>

<script>
import formCreate from '@form-create/element-ui'
export default {
  props: {
    FcDesignerRule: {
      type: String,
      require: true,
    },
    FcDesignerOptions: {
      type: String,
      require: true,
    },
  },
  data() {
    return {
      fapi: null,
      rule: '',
      option: '',
    }
  },
  created() {
    this.rule = formCreate.parseJson(this.FcDesignerRule)
    this.option = formCreate.parseJson(this.FcDesignerOptions)
  },
  methods: {
    onSubmit(formData, fapi) {
      console.log(fapi.rule, '表单数据')
      //todo 提交表单
    },
  },
}
</script>
